package org.example.test;

import org.junit.BeforeClass;
import org.junit.Test;
import org.example.sms.StudentManagementSystem03;

import java.io.IOException;



public class SMSTest02 {
    private static StudentManagementSystem03 sms;

    @BeforeClass
    public static void initData() throws IOException {
        sms = new StudentManagementSystem03();
        sms.loadStudentsFromFile("D:\\javase\\javase\\day25-junit-reflect-enum\\小学生信息.txt");
    }


    @Test
    public void showAllStudents(){
        sms.showAllStudents();
    }


    @Test
    public void writeRankedStudentsToFile() throws IOException {
        sms.writeRankedStudentsToFile("D:\\javase\\javase\\day25-junit-reflect-enum\\总分排名.txt");
    }

    @Test
    public void getScoreStatisticsBySubject() {
        System.out.println(sms.getScoreStatisticsBySubject("语文"));
    }

    @Test
    public void sortByTotalScore() {
        sms.sortByTotalScore();
        sms.showAllStudents();
    }

    @Test
    public void randomRollCall() {
        System.out.println(sms.randomRollCall());
    }
}